<?php
session_start();
//Now he/she can't just go to completed.php. They need to answer all the questions before the ae congratulated. So we check if they have actualy finished
if(isset($_SESSION["completed"])){
    if($_SESSION["completed"]=="1"){
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Completed</title>
</head>

<body>
<h1>Congratulations!!!</h1>
You've won the quiz in <?php echo($_SESSION["trys"]) ?> tries!
<br/>
<a href="tryagain.php">Try Again</a>
</body>
</body>
</html>
<?php
//If they haven't answered the questions then back they go to asnwer them!
    }
    else{
        header("location: takequiz.php");
    }
}
else{
    header("location: takequiz.php");
}
?>